/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package merlion.mrp.ppm.entity;

import java.io.Serializable;
import java.util.ArrayList;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OrderBy;

/**
 *
 * @author Zhu Xin
 */
@Entity
public class BackOrderIndiv implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    
    @OrderBy("index")
    private ArrayList<IndexNValue> quantities;
    
    public BackOrderIndiv() {
        quantities = new ArrayList<IndexNValue>();
    }
    

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public ArrayList<IndexNValue> getQuantities() {
        return quantities;
    }

    public void setQuantities(ArrayList<IndexNValue> quantities) {
        this.quantities = quantities;
    }

    
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof BackOrderIndiv)) {
            return false;
        }
        BackOrderIndiv other = (BackOrderIndiv) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "merlion.mrp.ppm.entity.BackOrderIndiv[ id=" + id + " ]";
    }
    
}
